//
//  LIUMovieCell.m
//  RxNet
//
//  Created by liuyu on 17/12/16.
//  Copyright (c) 2016 limit. All rights reserved.
//

#import "LIUMovieCell.h"
#import "LIUMovie.h"

@interface LIUMovieCell ()

@property (nonatomic, weak) UILabel *label;
@end

@implementation LIUMovieCell

+ (instancetype)movieWithTableView:(UITableView *)tableView reuseIdentifier:(NSString *)reuseIdentifier {
    LIUMovieCell *movieCell = [tableView dequeueReusableCellWithIdentifier:reuseIdentifier];
    if (!movieCell) {
        movieCell = [[LIUMovieCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseIdentifier];
    }
    return movieCell;
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
//        [self setup];
    }
    return self;
}

//- (void)setup {
//    UILabel *label = [[UILabel alloc] initWithFrame:(CGRect) {0, 0, 100, 30}];
//    label.numberOfLines = 0;
//    [self addSubview:label];
//    self.label = label;
//}
//
//- (void)setMovie:(LIUMovie *)movie {
//    _movie = movie;
//    self.label.text = movie.title;
//}

/**
 *  重写drawRect:方法自定义cell分割线
 */
- (void)drawRect:(CGRect)rect {
    CGContextRef context = UIGraphicsGetCurrentContext();
    CGContextSetFillColorWithColor(context, [UIColor clearColor].CGColor);
    CGContextFillRect(context, rect);

    CGContextSetStrokeColorWithColor(context, LIUColor(150, 150, 153, 0.3).CGColor);
    CGContextStrokeRect(context, CGRectMake(10, rect.size.height, rect.size.width - 10, 1));
}
@end
